package ro.bluecube.admlocal.registruagricol.entity;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import ro.bluecube.admlocal.commons.PersistableEntity;

@Entity
@NamedQueries( {
		@NamedQuery(name = "findAll", query = "SELECT L FROM Localitate L"),
		@NamedQuery(name = "findByDenumire", query = "SELECT L FROM Localitate L where L.denumire = ?1") ,
		@NamedQuery(name = "findById", query = "SELECT L FROM Localitate L where L.id = ?1")})
@Table(name="localitati")
public class Localitate extends PersistableEntity {

	private static final long serialVersionUID = 1L;

	private String denumire;

	public void setDenumire(String denumire) {
		this.denumire = denumire;
	}

	public String getDenumire() {
		return denumire;
	}

	
	@OneToMany(mappedBy="id")
	public Set<Titular> getTitulari() {
		return titulari;
	}
	private Set<Titular> titulari;

	public void setTitulari(Set<Titular> titulari) {
		this.titulari = titulari;
	}
}
